<?php


/**
 * home_login actions.
 *
 * @package    Aceptor
 * @subpackage home_login
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class home_loginActions extends sfActions
{


public function preExecute()
{
     if(sfConfig::get('app_domain')=='server')
     {
          $simpleSAMLAuth = new SimpleSAML_Auth_Simple('default-sp');
          if (!$simpleSAMLAuth->isAuthenticated())
          {
               return $this->redirect('@logout_aplication');
          }
     }    

  }



public function executeIndex(sfWebRequest $request)
{
        $validate_type_user = $this->getUser()->getAttribute('ses_tipo_user','null');
        if($validate_type_user!='null'){
               $this->redirect('@home_profesional');              
         }else{
               return sfView::SUCCESS;
         }    
}


}
